home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor26_inet.lha / rexx / JoinNewGroup.thor < prev    next >
Text File  |  1999-01-17  |  2KB  |  61 lines

  1. /*
  2. $VER: JoinNewGroup.thor 1.1 (21.06.96)
  3. (c)  Neil Bothwick <neil@wirenet.co.uk> 1996
  4. */
  5.  
  6. /* Presents the contents of a NewGroups message in a    */
  7. /* listview and creates join events for those selected  */
  8.  
  9. options results
  10.  
  11. /* needs THOR and bbsread.library functions */
  12.  
  13. thorport = address()
  14. if left(thorport,5) ~= 'THOR.' then do
  15.     say 'No THOR port found. This script must be run from Thor.'
  16.     exit 10
  17.     end
  18.  
  19. if ~show('p', 'BBSREAD') then do
  20.     address command
  21.     'run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead'
  22.     'WaitForPort BBSREAD'
  23.     end
  24.  
  25. address(thorport)
  26. drop MSG.
  27. CURRENTMSG stem MSG                                         /* Get info on current message */
  28. if rc ~= 0 then ExitMsg(THOR.LASTERROR)
  29. if upper(MSG.CONFNAME) ~= 'INFORMATION' then ExitMsg('This script only works from the Information conference')
  30.  
  31. address(bbsread)                                            /* Read list of new newsgroups */
  32. drop TEXT.
  33. READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR textstem TEXT
  34.  
  35. address(thorport)
  36. drop PICKED.
  37. REQUESTLIST instem TEXT.TEXT outstem PICKED                 /* Show new groups in a listview */
  38.  
  39. if RC = 5 then ExitMsg('No newsgroup selected')
  40. if RC > 0 then ExitMsg(THOR.LASTERROR)
  41.  
  42. NewGroup = RESULT
  43.  
  44. address(bbsread)
  45. drop NEWEVENT.                                              /* Create join event */
  46. NEWEVENT.CONFERENCE = NewGroup
  47. WRITEBREVENT bbsname '"'MSG.BBSNAME'"' event 2 stem NEWEVENT
  48. if rc ~= 0 then ExitMsg(BBSREAD.LASTERROR)
  49.  
  50. address(thorport)
  51. REQUESTNOTIFY '"'NewGroup' joined"' '"OK"'
  52.  
  53. exit
  54.  
  55. ExitMsg:
  56.     address(thorport)
  57.     parse arg errmsg
  58.     REQUESTNOTIFY '"'errmsg'"' '" OK "'
  59.     exit
  60.  
  61.